/*    */ package tools;
/*    */ 
/*    */ import java.util.Properties;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class PropertyTool
/*    */ {
/* 14 */   private Properties props = new Properties();
/*    */   
/*    */   public PropertyTool(Properties props) {
/* 17 */     this.props = props;
/*    */   }
/*    */   
/*    */   public byte getSettingByte(String key, byte def) {
/* 21 */     String property = this.props.getProperty(key);
/* 22 */     if (property != null) {
/* 23 */       return Byte.parseByte(property);
/*    */     }
/* 25 */     return def;
/*    */   }
/*    */   
/*    */   public short getSettingShort(String key, short def) {
/* 29 */     String property = this.props.getProperty(key);
/* 30 */     if (property != null) {
/* 31 */       return Short.parseShort(property);
/*    */     }
/* 33 */     return def;
/*    */   }
/*    */   
/*    */   public int getSettingInt(String key, int def) {
/* 37 */     String property = this.props.getProperty(key);
/* 38 */     if (property != null) {
/* 39 */       return Integer.parseInt(property);
/*    */     }
/* 41 */     return def;
/*    */   }
/*    */   
/*    */   public long getSettingLong(String key, long def) {
/* 45 */     String property = this.props.getProperty(key);
/* 46 */     if (property != null) {
/* 47 */       return Long.parseLong(property);
/*    */     }
/* 49 */     return def;
/*    */   }
/*    */   
/*    */   public String getSettingStr(String key, String def) {
/* 53 */     String property = this.props.getProperty(key);
/* 54 */     if (property != null) {
/* 55 */       return property;
/*    */     }
/* 57 */     return def;
/*    */   }
/*    */   
/*    */   public byte getSettingByte(String key) {
/* 61 */     return getSettingByte(key, (byte)-1);
/*    */   }
/*    */   
/*    */   public short getSettingShort(String key) {
/* 65 */     return getSettingShort(key, (short)-1);
/*    */   }
/*    */   
/*    */   public int getSettingInt(String key) {
/* 69 */     return getSettingInt(key, -1);
/*    */   }
/*    */   
/*    */   public long getSettingLong(String key) {
/* 73 */     return getSettingLong(key, -1L);
/*    */   }
/*    */   
/*    */   public String getSettingStr(String key) {
/* 77 */     return getSettingStr(key, null);
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\tools\PropertyTool.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */